/**

throws 和throw 抛出 myexception的对象 的message 
如果 账号或者密码不一致 就抛出 不然就执行下面的语句 并返回
 */
/*
package com.leo_自定义异常案例;

class UserService{
	public User login(String name,String password)throws MyException {
		if(!"admin".equals(name)) {
			throw new MyException("错误的账号！");
		}
		if(!"12345".equals(password)) {
			throw new MyException("错误的密码!");
		}
		User user=new User("admin","12345","male",18);
		return user;
	}
}
*/
 



